package com.yuw.control;

import com.yuw.bean.UserInfoBean;
import com.yuw.service.ILoginService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.Resource;


public class LoginControl {
    // 使用spring XML的配置方式，进行依赖注入
    @Autowired
    ILoginService loginService;
    @Resource
    UserInfoBean userInfoBean;

    /**
     * 进行登录处理
     *
     * @return
     */
    public boolean doLogin() {
        boolean canLogined = false;

        // 调用service层
        // 进行登录业务逻辑
        canLogined = loginService.doLogin(userInfoBean);
        System.out.println("-----------------------");
        loginService.doSleeping();
        return canLogined;
    }

    public ILoginService getLoginService() {
        return loginService;
    }

    public void setLoginService(ILoginService loginService) {
        this.loginService = loginService;
    }

    public UserInfoBean getUserInfoBean() {
        return userInfoBean;
    }

    public void setUserInfoBean(UserInfoBean userInfoBean) {
        this.userInfoBean = userInfoBean;
    }

}
